﻿Imports ML.Framework.Collections

Public Class Band
    Inherits SongArtist
    Implements IMediaFileCreatorGroup(Of SongArtist)

    Private _SongArtists As ReadOnlyCollection(Of SongArtist)

    Public ReadOnly Property Artists() As IEnumerable(Of SongArtist) Implements IMediaFileCreatorGroup(Of ML.IpodMediaCenter.SongArtist).CoCreators
        Get
            Return _SongArtists
        End Get
    End Property

    Public Sub New(ByVal name As String, ByVal Artists As IEnumerable(Of SongArtist))
        MyBase.New(name)

        For Each artist As SongArtist In Artists
            If TypeOf artist Is IMediaFileCreatorGroup(Of SongArtist) Then
                Throw New InvalidSongArtistException("The Song Artists in a Band cannot be other Bands")
                Exit Sub
            End If
        Next
        _SongArtists = New ReadOnlyCollection(Of SongArtist)(Artists)
    End Sub
End Class
